# Build recipe for Scid vs PC.
#
# Copyright 2016, 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
#
# This recipe is free software, under the terms of the Apache License 2.0

program=scid_vs_pc
version=4.17
release=1

tarname=${program}-${version}.tgz

# Remote source(s)
fetch=http://sourceforge.net/projects/scidvspc/files/source/$tarname

description="
Shane's Chess Information Database is a powerful Chess Toolkit, with
which one can create huge databases, run chess engines, and play
casual games against the computer or online with the Free Internet
Chess Server. It was originally written by Shane Hudson , and has
received strong contribution from Pascal Georges and others.

Scid vs. PC began with bug-fixes for the computer-versus-player
features of Scid (hence the name), but has evolved into a solid
alternative with many new features and interfaces. The project is
authored by Stevenaaus and numerous contributors (thanks).
"

homepage=http://scidvspc.sourceforge.net/
license=GPLv2

# Source documentation
docs="COPYING README*"
docsdir="${docdir}/${program}-${version}"

build() {
    unpack "${tardir}/$tarname"

    cd "$srcdir"
    ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docdir \
     --build="$(cc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Copy documentation
    mkdir -p "${destdir}${docsdir}"
    cp -p $docs "${destdir}${docsdir}"
}
